﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Docentric.Examples.Data.TypedDataSets.NorthwindDataSetTableAdapters;



namespace Docentric.Examples.Data.TypedDataSets
{
	public static class DataAccess
	{
		public static NorthwindDataSet.Purchase_OrdersDataTable LoadPurchaseOrders()
		{
			// Load all needed data (purchase orders, details, suppliers, products).
			NorthwindDataSet ds = new NorthwindDataSet();
			Purchase_OrdersTableAdapter poAdapter = new Purchase_OrdersTableAdapter();
			poAdapter.Fill(ds.Purchase_Orders);
			Purchase_Order_DetailsTableAdapter dAdapter = new Purchase_Order_DetailsTableAdapter();
			dAdapter.Fill(ds.Purchase_Order_Details);
			SuppliersTableAdapter suppAdapter = new SuppliersTableAdapter();
			suppAdapter.Fill(ds.Suppliers);
			ProductsTableAdapter prodAdapter = new ProductsTableAdapter();
			prodAdapter.Fill(ds.Products);
			EmployeesTableAdapter empAdapter = new EmployeesTableAdapter();
			empAdapter.Fill(ds.Employees);

			return ds.Purchase_Orders;
		}
	}
}
